﻿#ifndef OPENGL_LINES5_H
#define OPENGL_LINES5_H

#include <QOpenGLWindow>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QtMath>
#include <QtDebug>
#include <QMap>
#include <QElapsedTimer>

class OpenGL_Lines5 : public QOpenGLWindow, protected QOpenGLFunctions
{
public:
    OpenGL_Lines5(QOpenGLWindow *parent = nullptr);
    ~OpenGL_Lines5();

protected:
    void initializeGL();
    void resizeGL(int w, int h);
    void paintGL();

private:
    void initializeOriginArraies(int num);

private:
    QElapsedTimer *time;
    QOpenGLShaderProgram *shaderProgram;
    qreal *originPosX;
    qreal *originPosY;
    int pointsAmount;

    int color;
    QVector4D lineColor;

    int xposAttri;
    int yposAttri;
    QMap<int, GLfloat> hashX;
    QMap<int, GLfloat> hashY;

    int count;
};

#endif // OPENGL_LINES5_H
